1. Field of the Invention
The present invention relates to a movement vector generating apparatus and an image encoding apparatus, for generating a movement vector corresponding to a movement compensation when the movement compensation involving an inter-frame prediction represented by a so-called MPEG (Moving Picture Experts Group) method is executed to compress and encode image information.
2. Description of the Related Art
A so-called movement compensating process is used in an image encoding process, such as the above-mentioned MPEG method and the like.
In this movement compensating process, at first, an image to be encoded is divided into pixel blocks each including a predetermined number of pixels which is set in advance (e.g., divided into macro blocks in the case of the MPEG method). Then, an absolute value of a difference between each pixel within each pixel block and the corresponding pixel within any one frame located forward or backward on a time axis is calculated. Then, the sum is obtained by summing up the absolute values in all pixels within the pixel block. Then, a spatial position of the image, in which the above-mentioned sum of the absolute values becomes minimum is determined (i.e., the spatial position of the image which is located the closest to the image within the pixel block and belongs to any one frame located forward or backward on the time axis).
Then, the relationship between the pixel block and the closest image thereto is defined as a movement vector. Then, this movement vector is encoded as information representing the image within any one frame located forward or backward on the time axis. Accordingly, the image information can be encoded with compressing a sufficient amount of the information to be actually encoded.
In the above mentioned movement compensating process, when the closest image to the pixel block to be encoded is searched within any one frame located forward or backward on the time axis, a search range and a search accuracy within the frame are common for all the pixel blocks within the image information to be encoded.
This search of the movement vector needs a vast amount of calculation.
Therefore, if the searching process is simplified so as to reduce the calculation amount in the case of using the uniform search range and search accuracy for all the pixel blocks, the exact movement vector cannot be determined, which results in a deterioration of the image quality after the decoding operation, which is a problem.
On the other hand, although a uniform enlargement of the search range is effective in order to improve the image quality, with respect to an image having the heavy movement as a whole image of a single frame (for example, an image photographed when a camera photographing the image is moving (panning)), the calculation amount is further increased, which is also a problem.
As a countermeasure for this, the uniform enlargement of the search range for a slender (little) movement causes the calculation amount to be increased. That is, a proper vector calculation cannot be performed, depending on the characteristic of the image information. This results in the problem of the deterioration of the image quality or the unnecessary increase of the calculation amount.